home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / lang / sofa.lha / sofa / smalleiffel / lib_se / run_feature_4.e < prev    next >
Text File  |  2000-03-25  |  22KB  |  787 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr
  4. --                       http://SmallEiffel.loria.fr
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License
  11. -- for  more  details.  You  should  have  received a copy of the GNU General
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. class RUN_FEATURE_4
  17.  
  18. inherit RUN_FEATURE;
  19.  
  20. creation make
  21.  
  22. feature
  23.  
  24.    base_feature: FUNCTION;
  25.  
  26.    arguments: FORMAL_ARG_LIST;
  27.  
  28.    result_type: TYPE;
  29.  
  30.    require_assertion: RUN_REQUIRE;
  31.  
  32.    local_vars: LOCAL_VAR_LIST;
  33.  
  34.    routine_body: COMPOUND;
  35.  
  36.    rescue_compound: COMPOUND;
  37.  
  38.    ensure_assertion: E_ENSURE;
  39.  
  40.    static_value_mem: INTEGER;
  41.  
  42.    is_deferred: BOOLEAN is false;
  43.  
  44.    is_pre_computable: BOOLEAN is false;
  45.  
  46.    is_once_procedure: BOOLEAN is false;
  47.  
  48.    is_once_function: BOOLEAN is false;
  49.  
  50.    is_static: BOOLEAN is
  51.       do
  52.          if isa_in_line then
  53.             Result := is_static_flag;
  54.          end;
  55.       end;
  56.  
  57.    afd_check is
  58.       do
  59.          routine_afd_check;
  60.       end;
  61.  
  62.    can_be_dropped: BOOLEAN is
  63.       do
  64.          Result := ((arguments = Void) and then
  65.                     (local_vars = Void) and then
  66.                     (require_assertion = Void) and then
  67.                     (ensure_assertion = Void) and then
  68.                     (rescue_compound = Void));
  69.          if Result then
  70.             if routine_body /= Void then
  71.                Result := false;
  72.             end;
  73.          end;
  74.       end;
  75.  
  76.    mapping_c is
  77.       local
  78.          tmp_expanded_idx: INTEGER;
  79.       do
  80.          if isa_in_line then
  81.             in_line;
  82.          else
  83.             tmp_expanded_idx := cpp.se_tmp_open(Current);
  84.             default_mapping_function;
  85.             if tmp_expanded_idx >= 0 then
  86.                cpp.se_tmp_close(tmp_expanded_idx);
  87.             end;
  88.          end;
  89.       end;
  90.  
  91.    c_define is
  92.       do
  93.          if isa_in_line then
  94.             cpp.incr_inlined_function_count;
  95.          else
  96.             if use_current then
  97.                cpp.incr_function_count;
  98.             else
  99.                cpp.incr_real_function_count;
  100.             end;
  101.             define_prototype;
  102.             c_define_opening;
  103.             if routine_body /= Void then
  104.                routine_body.compile_to_c;
  105.             end;
  106.             c_define_closing;
  107.             cpp.put_string(fz_15);
  108.             c_frame_descriptor;
  109.          end;
  110.       end;
  111.  
  112. feature {CALL_PROC_CALL}
  113.  
  114.    collect_c_tmp is
  115.       local
  116.          a: ASSIGNMENT;
  117.          c: CALL;
  118.       do
  119.          if result_type.is_user_expanded then
  120.             if result_type.is_dummy_expanded then
  121.             elseif isa_in_line then
  122.                inspect
  123.                   in_line_status
  124.                when C_dca then
  125.                   a ?= routine_body.first;
  126.                   c ?= a.right_side;
  127.                   c.finalize;
  128.                   c.run_feature.collect_c_tmp;
  129.                else
  130.                end;
  131.             else
  132.                cpp.se_tmp_add(Current);
  133.             end;
  134.          end;
  135.       end;
  136.  
  137. feature {ADDRESS_OF_POOL}
  138.  
  139.    address_of_c_define(caller: ADDRESS_OF) is
  140.       do
  141.          if run_control.boost then
  142.             if isa_in_line then
  143.                address_of_c_define_wrapper(caller);
  144.             elseif use_current then
  145.             else
  146.                address_of_c_define_wrapper(caller);
  147.             end;
  148.          else
  149.             address_of_c_define_wrapper(caller);
  150.          end;
  151.       end;
  152.  
  153. feature {ADDRESS_OF}
  154.  
  155.    address_of_c_mapping is
  156.       do
  157.          if run_control.boost then
  158.             if isa_in_line then
  159.                address_of_c_mapping_wrapper;
  160.             elseif use_current then
  161.                mapping_name;
  162.             else
  163.                address_of_c_mapping_wrapper;
  164.             end;
  165.          else
  166.             address_of_c_mapping_wrapper;
  167.          end;
  168.       end;
  169.  
  170. feature {FUNCTION}
  171.  
  172.    is_empty_or_null_body: BOOLEAN is
  173.       do
  174.          if isa_in_line then
  175.             Result := in_line_status = C_empty_or_null_body;
  176.          end;
  177.       end;
  178.  
  179.    is_attribute_reader: RUN_FEATURE_2 is
  180.          -- Gives Void or the attribute read.
  181.       local
  182.          c0: CALL_0;
  183.       do
  184.          if isa_in_line then
  185.             if in_line_status = C_attribute_reader then
  186.                c0 ?= body_one_result;
  187.                Result ?= c0.run_feature;
  188.             end;
  189.          end;
  190.       end;
  191.  
  192.    is_direct_call_on_attribute: CALL is
  193.          -- Gives Void or the corresponding call.
  194.       do
  195.          if isa_in_line then
  196.             inspect
  197.                in_line_status
  198.             when C_dca then
  199.                Result ?= body_one_result;
  200.             else
  201.             end;
  202.          end;
  203.       end;
  204.  
  205. feature {NONE}
  206.  
  207.    initialize is
  208.       do
  209.          arguments := base_feature.arguments;
  210.          result_type := base_feature.result_type;
  211.          if result_type.is_like_argument then
  212.             if not arguments.is_runnable(current_type) then
  213.                !!arguments.with(arguments,current_type);
  214.             end;
  215.             result_type := result_type.to_runnable(current_type);
  216.          else
  217.             result_type := result_type.to_runnable(current_type);
  218.             if arguments /= Void then
  219.                if not arguments.is_runnable(current_type) then
  220.                   !!arguments.with(arguments,current_type);
  221.                end;
  222.             end;
  223.          end;
  224.          local_vars := base_feature.local_vars;
  225.          if local_vars /= Void then
  226.             local_vars := local_vars.to_runnable(current_type);
  227.          end;
  228.          routine_body := base_feature.routine_body;
  229.          if routine_body /= Void then
  230.             routine_body := routine_body.to_runnable(current_type);
  231.          end;
  232.          if run_control.require_check then
  233.             require_assertion := run_require;
  234.          end;
  235.          if run_control.ensure_check then
  236.             ensure_assertion := run_ensure;
  237.          end;
  238.          rescue_compound := base_feature.rescue_compound;
  239.          if rescue_compound = Void then
  240.             rescue_compound := default_rescue_compound;
  241.          end;
  242.          if rescue_compound /= Void then
  243.             exceptions_handler.set_used;
  244.             rescue_compound := rescue_compound.to_runnable(current_type);
  245.          end;
  246.       end;
  247.  
  248.    in_line_status: INTEGER;
  249.          -- Value 0 means not computed.
  250.          -- Value -1 means not `isa_in_line'.
  251.  
  252.    is_static_flag: BOOLEAN;
  253.  
  254.    isa_in_line: BOOLEAN is
  255.       do
  256.          if run_control.boost then
  257.             inspect
  258.                in_line_status
  259.             when -1 then
  260.             when 0 then
  261.                Result := true;
  262.                if rescue_compound /= Void then
  263.                   in_line_status := -1;
  264.                   Result := false;
  265.                elseif empty_or_null_body then
  266.                   in_line_status := C_empty_or_null_body;
  267.                elseif value_reader then
  268.                   in_line_status := C_value_reader;
  269.                elseif attribute_reader then
  270.                   in_line_status := C_attribute_reader;
  271.                elseif result_is_current then
  272.                   in_line_status := C_result_is_current;
  273.                elseif direct_call then
  274.                   in_line_status := C_direct_call;
  275.                   -- *** SHOULD USE isa_dca_inline TOO ??
  276.                elseif dca then
  277.                   in_line_status := C_dca;
  278.                elseif a_eq_neq then
  279.                   in_line_status := C_a_eq_neq;
  280.                elseif dc_pco1 then
  281.                   in_line_status := C_dc_pco1;
  282.                elseif dc_pco2 then
  283.                   in_line_status := C_dc_pco2;
  284.                elseif direct_cse_call then
  285.                   in_line_status := C_direct_cse_call;
  286.                else
  287.                   in_line_status := -1;
  288.                   Result := false;
  289.                end;
  290.             else
  291.                Result := true;
  292.             end;
  293.          end;
  294.       end;
  295.  
  296.    empty_or_null_body: BOOLEAN is
  297.          -- The body is empty or has only unreacheable code.
  298.       local
  299.          rb: COMPOUND;
  300.       do
  301.          rb := routine_body;
  302.          if (rb = Void or else rb.empty_or_null_body)
  303.             and then local_vars = Void
  304.           then
  305.             static_value_mem := 0;
  306.             is_static_flag := true;
  307.             Result := true;
  308.          end;
  309.       end;
  310.  
  311.    value_reader: BOOLEAN is
  312.          -- True when the function body has only one instruction
  313.          -- of the form :
  314.          --      Result := <expression>;
  315.          -- Where <expression> is statically computable.
  316.       local
  317.          e: EXPRESSION;
  318.          c0: CALL_0;
  319.       do
  320.          e := body_one_result;
  321.          if e /= Void and then local_vars = Void then
  322.             c0 ?= e;
  323.             if c0 /= Void and then
  324.                c0.target.is_current and then
  325.                c0.run_feature = Current
  326.              then
  327.                eh.add_position(e.start_position);
  328.                fatal_error("Infinite recursive call.");
  329.             elseif e.is_static then
  330.                Result := true;
  331.                static_value_mem := e.static_value;
  332.                is_static_flag := true;
  333.             end;
  334.          end;
  335.       end;
  336.  
  337.    attribute_reader: BOOLEAN is
  338.          -- True when the function has no arguments, no locals, and
  339.          -- when the body has only one instruction of the form :
  340.          --      Result := attribute;
  341.          -- Where `attribute' is a RUN_FEATURE_2.
  342.       local
  343.          e: EXPRESSION;
  344.          c0: CALL_0;
  345.          rf2: RUN_FEATURE_2;
  346.       do
  347.          e := body_one_result;
  348.          if e /= Void and then local_vars = Void then
  349.             c0 ?= e;
  350.             if c0 /= Void then
  351.                if c0.target.is_current then
  352.                   rf2 ?= c0.run_feature;
  353.                   if rf2 /= Void then
  354.                      Result := not rf2.result_type.is_user_expanded;
  355.                   end;
  356.                end;
  357.             end;
  358.          end;
  359.       end;
  360.  
  361.    result_is_current: BOOLEAN is
  362.       local
  363.          e: EXPRESSION;
  364.       do
  365.          e := body_one_result;
  366.          if e /= Void and then local_vars = Void then
  367.             Result := e.is_current;
  368.          end;
  369.       end;
  370.  
  371.    direct_call: BOOLEAN is
  372.          -- True when the function has no arguments, no locals, and
  373.          -- when the body has only one instruction of the form :
  374.          --    Result := foo(<args>);
  375.          -- Where <args> can be an empty list or a statically
  376.          -- computable one.
  377.          -- Where `foo' is a RUN_FEATURE_4.
  378.       local
  379.          e: EXPRESSION;
  380.          c: CALL;
  381.          args: EFFECTIVE_ARG_LIST;
  382.          rf4: RUN_FEATURE_4;
  383.       do
  384.          e := body_one_result;
  385.          if e /= Void and then
  386.             arguments = Void and then
  387.             local_vars = Void
  388.           then
  389.             c ?= e;
  390.             if c /= Void then
  391.                if c.target.is_current then
  392.                   rf4 ?= c.run_feature;
  393.                   if rf4 /= Void then
  394.                      args := c.arguments;
  395.                      if args = Void then
  396.                         Result := true;
  397.                      else
  398.                         Result := args.is_static;
  399.                      end;
  400.                   end;
  401.                end;
  402.             end;
  403.          end;
  404.       end;
  405.  
  406.    dca: BOOLEAN is
  407.          -- Direct Call on Attribute.
  408.       local
  409.          c: CALL;
  410.          rf: RUN_FEATURE;
  411.          args: EFFECTIVE_ARG_LIST;
  412.       do
  413.          c := body_one_result_dca;
  414.          if c /= Void and then local_vars = Void then
  415.             rf := c.run_feature;
  416.             if rf /= Void then
  417.                if rf /= Current then
  418.                   if rf.current_type.is_user_expanded then
  419.                      -- Not yet inlined :-(
  420.                   else
  421.                      args := c.arguments;
  422.                      if args = Void then
  423.                         Result := arguments = Void;
  424.                      else
  425.                         Result := args.isa_dca_inline(Current,rf);
  426.                      end;
  427.                   end;
  428.                end;
  429.             end;
  430.          end;
  431.       end;
  432.  
  433.    a_eq_neq: BOOLEAN is
  434.          -- Attribute "=" or "/=".
  435.       local
  436.          c: CALL;
  437.          rf: RUN_FEATURE;
  438.          e: EXPRESSION;
  439.       do
  440.          c := body_one_result_dca;
  441.          if c /= Void and then local_vars = Void then
  442.             rf := c.run_feature;
  443.             if rf = Void and then c.arg_count = 1 then
  444.                -- For "=" and "/=" :
  445.                e := c.arguments.expression(1);
  446.                inspect
  447.                   e.isa_dca_inline_argument
  448.                when 0 then
  449.                when -1 then
  450.                   Result := arguments = Void;
  451.                else
  452.                   if arguments /= Void then
  453.                      Result := arguments.count = 1;
  454.                   end;
  455.                end;
  456.             end;
  457.          end;
  458.       end;
  459.  
  460.    dc_pco1: BOOLEAN is
  461.       local
  462.          c: CALL;
  463.          rf6: RUN_FEATURE_6;
  464.       do
  465.          c := body_one_dc_pco;
  466.          if c /= Void and then c.target.is_current then
  467.             rf6 ?= c.run_feature;
  468.             if rf6 /= Void then
  469.                Result := not rf6.use_current;
  470.             end;
  471.          end;
  472.       end;
  473.  
  474.    dc_pco2: BOOLEAN is
  475.       local
  476.          c1, c2: CALL;
  477.          rf6: RUN_FEATURE_6;
  478.       do
  479.          c1 := body_one_dc_pco;
  480.          if c1 /= Void then
  481.             c2 ?= c1.target;
  482.             if c2 /= Void then
  483.                rf6 ?= c2.run_feature;
  484.                if rf6 /= Void and then
  485.                   not rf6.use_current and then
  486.                   c2.target.is_current
  487.                 then
  488.                   Result := true;
  489.                end;
  490.             end;
  491.          end;
  492.       end;
  493.  
  494.    direct_cse_call: BOOLEAN is
  495.       local
  496.          c: CALL;
  497.          rf8: RUN_FEATURE_8;
  498.       do
  499.          if arguments = Void and then local_vars = Void then
  500.             c ?= body_one_result;
  501.             if c /= Void and then c.arguments = Void then
  502.                c ?= c.target;
  503.                if c /= Void and then c.target.is_current then
  504.                   if c.arguments = Void then
  505.                      rf8 ?= c.run_feature;
  506.                      if rf8 /= Void then
  507.                         Result := rf8.name.to_string = as_to_pointer;
  508.                      end;
  509.                   end;
  510.                end;
  511.             end;
  512.          end;
  513.       end;
  514.  
  515.    in_line is
  516.       local
  517.          a: ASSIGNMENT;
  518.          e: EXPRESSION;
  519.          flag: BOOLEAN;
  520.          c: CALL;
  521.          rf: RUN_FEATURE;
  522.          cien: CALL_INFIX2;
  523.          rt: TYPE;
  524.       do
  525.          cpp.put_string("/*(IRF4.");
  526.          cpp.put_integer(in_line_status);
  527.          cpp.put_string(name.to_string);
  528.          cpp.put_string(fz_close_c_comment);
  529.          inspect
  530.             in_line_status
  531.          when C_empty_or_null_body then
  532.             flag := cpp.cannot_drop_all;
  533.             if flag then
  534.                cpp.put_character(',');
  535.             end;
  536.             rt := result_type.run_type;
  537.             if rt.is_user_expanded then
  538.                cpp.put_character('M');
  539.                cpp.put_integer(rt.id);
  540.             else
  541.                rt.c_initialize;
  542.             end;
  543.             if flag then
  544.                cpp.put_character(')');
  545.             end;
  546.          when C_value_reader then
  547.             flag := cpp.cannot_drop_all;
  548.             if flag then
  549.                cpp.put_character(',');
  550.             end;
  551.             a ?= routine_body.first;
  552.             e := a.right_side;
  553.             cpp.put_character('(');
  554.             e.compile_to_c;
  555.             cpp.put_character(')');
  556.             if flag then
  557.                cpp.put_character(')');
  558.             end;
  559.          when C_attribute_reader then
  560.             flag := cpp.arguments_cannot_be_dropped;
  561.             if flag then
  562.                cpp.put_character(',');
  563.             end;
  564.             a ?= routine_body.first;
  565.             c ?= a.right_side;
  566.             rf := c.run_feature;
  567.             rf.mapping_c;
  568.             if flag then
  569.                cpp.put_character(')');
  570.             end;
  571.          when C_result_is_current then
  572.             flag := cpp.arguments_cannot_be_dropped;
  573.             if flag then
  574.                cpp.put_character(',');
  575.             end;
  576.         rt := result_type.run_type;
  577.         if rt.is_basic_eiffel_expanded then
  578.            cpp.put_character('(');
  579.            cpp.put_target_as_value;
  580.            cpp.put_character(')');
  581.         else
  582.            tmp_string.copy(fz_17);
  583.            rt.c_type_for_result_in(tmp_string);
  584.            tmp_string.append(fz_22);
  585.            cpp.put_string(tmp_string);
  586.            cpp.put_target_as_value;
  587.            cpp.put_string(fz_13);
  588.         end;
  589.             if flag then
  590.                cpp.put_character(')');
  591.             end;
  592.          when C_direct_call then
  593.             a ?= routine_body.first;
  594.             c ?= a.right_side;
  595.             rf := c.run_feature;
  596.             cpp.push_same_target(rf,c.arguments);
  597.             rf.mapping_c;
  598.             cpp.pop;
  599.          when C_dca then
  600.             a ?= routine_body.first;
  601.             c ?= a.right_side;
  602.             cpp.push_inline_dca(Current,c);
  603.             c.run_feature.mapping_c;
  604.             cpp.pop;
  605.          when C_a_eq_neq then
  606.             a ?= routine_body.first;
  607.             cien ?= a.right_side;
  608.             cpp.push_inline_dca(Current,cien);
  609.             cien.dca_inline(cien.arg1.result_type);
  610.             cpp.pop;
  611.          when C_dc_pco1, C_dc_pco2 then
  612.             flag := cpp.target_cannot_be_dropped;
  613.             if flag then
  614.                cpp.put_character(',');
  615.             end;
  616.             a ?= routine_body.first;
  617.             c ?= a.right_side;
  618.             rf := c.run_feature;
  619.             cpp.push_direct(rf,c.target,c.arguments);
  620.             rf.mapping_c;
  621.             cpp.pop;
  622.             if flag then
  623.                cpp.put_character(')');
  624.             end;
  625.          when C_direct_cse_call then
  626.             a ?= routine_body.first;
  627.             c ?= a.right_side;
  628.             rf := c.run_feature;
  629.             cpp.push_same_target(rf,c.arguments);
  630.             rf.mapping_c;
  631.             cpp.pop;
  632.          end;
  633.          cpp.put_string("/*)*/");
  634.       end;
  635.  
  636.    compute_use_current is
  637.       local
  638.          ct: like current_type;
  639.       do
  640.          ct := current_type;
  641.          if ct.is_reference then
  642.             if run_control.no_check then
  643.                use_current_state := ucs_true;
  644.             else
  645.                std_compute_use_current;
  646.             end;
  647.          else
  648.             std_compute_use_current;
  649.          end;
  650.       end;
  651.  
  652.    body_one_result: EXPRESSION is
  653.          -- Gives the RHS expression if the body has only one
  654.          -- instruction of the form :
  655.          --        Result := <RHS>;
  656.       local
  657.          rb: like routine_body;
  658.          a: ASSIGNMENT;
  659.       do
  660.          rb := routine_body;
  661.          if rb /= Void and then rb.count = 1 then
  662.             a ?= rb.first;
  663.             if a /= Void then
  664.                if a.left_side.is_result then
  665.                   Result := a.right_side;
  666.                end;
  667.             end;
  668.          end;
  669.       end;
  670.  
  671.    body_one_result_dca: CALL is
  672.       local
  673.          c: CALL;
  674.          c0c: CALL_0_C;
  675.          writable_attribute: RUN_FEATURE_2;
  676.          rf: RUN_FEATURE;
  677.          r: ARRAY[RUN_CLASS];
  678.          bf: WRITABLE_ATTRIBUTE;
  679.       do
  680.          c ?= body_one_result;
  681.          if c /= Void then
  682.             c0c ?= c.target;
  683.             if c0c /= Void then
  684.                if c0c.target.is_current then
  685.                   writable_attribute ?= c0c.run_feature;
  686.                   if writable_attribute /= Void then
  687.                      r := writable_attribute.run_class.running;
  688.                      rf := c.run_feature;
  689.                      if rf = Void then -- Basic "=" and "/=" :
  690.                         Result := c;
  691.                      elseif r /= Void and then r.count = 1 then
  692.                         r := rf.run_class.running;
  693.                         if r /= Void and then r.count = 1 then
  694.                            bf := writable_attribute.base_feature;
  695.                            Result := c;
  696.                         end;
  697.                      end;
  698.                   end;
  699.                end;
  700.             end;
  701.          end;
  702.       end;
  703.  
  704.    body_one_dc_pco: CALL is
  705.       local
  706.          c: CALL;
  707.          args: EFFECTIVE_ARG_LIST;
  708.       do
  709.          c ?= body_one_result;
  710.          if c /= Void and then
  711.             local_vars = Void and then
  712.             arguments = Void
  713.           then
  714.             args := c.arguments;
  715.             if args = Void or else args.is_static then
  716.                Result := c;
  717.             end;
  718.          end;
  719.       end;
  720.  
  721. feature {NONE}
  722.  
  723.    C_empty_or_null_body  : INTEGER is 1;
  724.    C_value_reader        : INTEGER is 2;
  725.    C_attribute_reader    : INTEGER is 3;
  726.    C_result_is_current   : INTEGER is 4;
  727.    C_direct_call         : INTEGER is 5;
  728.    C_dca                 : INTEGER is 6;
  729.    C_a_eq_neq            : INTEGER is 7;
  730.    C_dc_pco1             : INTEGER is 8;
  731.    C_dc_pco2             : INTEGER is 9;
  732.    C_direct_cse_call     : INTEGER is 10;
  733.  
  734. feature {NONE}
  735.  
  736.    tmp_string: STRING is
  737.       once
  738.          !!Result.make(8);
  739.       end;
  740.  
  741. feature {RUN_CLASS}
  742.  
  743.    jvm_field_or_method is
  744.       do
  745.          jvm.add_method(Current);
  746.       end;
  747.  
  748. feature
  749.  
  750.    mapping_jvm is
  751.       do
  752.          routine_mapping_jvm;
  753.       end;
  754.  
  755. feature {JVM}
  756.  
  757.    jvm_define is
  758.       do
  759.          method_info_start;
  760.          jvm_define_opening;
  761.          if routine_body /= Void then
  762.             routine_body.compile_to_jvm;
  763.          end;
  764.          jvm_define_closing;
  765.          result_type.jvm_push_local(jvm_result_offset);
  766.          result_type.run_type.jvm_return_code;
  767.          method_info.finish;
  768.       end;
  769.  
  770. feature {NONE}
  771.  
  772.    compute_stupid_switch(r: ARRAY[RUN_CLASS]) is
  773.       do
  774.          std_compute_stupid_switch(r);
  775.       end;
  776.    
  777.    update_tmp_jvm_descriptor is
  778.       do
  779.          routine_update_tmp_jvm_descriptor;
  780.       end;
  781.  
  782.    stupid_switch_comment: STRING is "SSFRF4";
  783.  
  784. end -- RUN_FEATURE_4
  785.  
  786.  
  787.